// 团队相关类型定义
import { PageParams } from './common';

// 团队状态枚举
export enum TeamStatus {
  NORMAL = 0, // 正常
  DISABLED = 1, // 禁用
}

// 团队信息
export interface TeamInfo {
  id: number;
  name: string;
  status: TeamStatus;
  discount: string; // 团队折扣
  notes: string; // 备注
  teamManagerId: number; // 团队管理员ID
  createTime: string;
  updateTime: string;
  isDeleted: number;
}

// 团队创建/更新请求
export interface TeamCreateRequest {
  id?: number;
  name: string;
  status: TeamStatus;
  discount: string;
  notes: string;
  teamManagerId: number;
}

// 团队成员创建请求
export interface TeamUserCreateRequest {
  teamId: number;
  teamName: string;
  userId: number;
  userName: string;
  roleId: number;
  status: number;
}

// 团队分页查询参数
export interface TeamPageQueryParams extends PageParams {
  ascs?: string;
  descs?: string;
  searchKey?: string;
  teamName?: number;
}

// 团队表单（保留原有的，用于前端组件）
export interface TeamForm {
  name: string;
  status: TeamStatus;
  discount: number;
  memberIds: string[];
}

// 团队余额充值表单
export interface TeamBalanceRechargeForm {
  teamId: string;
  amount: number;
  remark?: string;
}

// 团队额度设置表单
export interface TeamCreditForm {
  teamId: string;
  credit: number;
  remark?: string;
}

// 团队账单记录
export interface TeamBillRecord {
  id: string;
  teamId: string;
  operatorId: string;
  operatorName: string;
  type: 'balance_recharge' | 'balance_consume' | 'balance_refund' | 'credit_set' | 'credit_consume' | 'credit_refund';
  amount: number;
  balance?: number;
  credit?: number;
  remark?: string;
  createdAt: string;
}

// 团队搜索参数
export interface TeamSearchParams {
  keyword?: string; // 团队名称
} 